package com.kimoge.spring6.jdbc.xmlbook.controller;

import com.kimoge.spring6.jdbc.xmlbook.service.BookService;
import com.kimoge.spring6.jdbc.xmlbook.service.CheckoutService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

/**
 * @author kimoge
 * @date 2025/8/29
 * @description
 */
@Controller
public class BookController {
    @Autowired
    private BookService bookService;
    @Autowired
    private CheckoutService checkoutService;

    public void buyBook(int userId,int bookId) {
        int row = bookService.buyBook(userId, bookId);
    }

    public void checkoutBook(int userId,int[] bookIds) {
        checkoutService.checkout(bookIds, userId);
    }

}
